<?php



/**

 * 	服务列表

*/



define('IN_ECS', true);



require(dirname(__FILE__) . '/includes/init.php');



if ((DEBUG_MODE & 2) != 2)

{

    $smarty->caching = true;

}

$act = isset($_REQUEST['act']) ? trim($_REQUEST["act"]) : 'mba';



$service = array(

	"mba" => array("1", "2", "3", "4", "5"),

	"master" => array("6", "2"),

);

$smarty->assign("act", $act);
$service_list = get_service_list($service[$act]);

$smarty->assign("service_list", $service_list);

assign_template();

$smarty->display("service_list.dwt");



function get_service_list($arr)

{

	$str = implode(",",$arr);

	$sql = "SELECT * FROM " . $GLOBALS['ecs']->table("service") . " WHERE id IN ($str)";

	$info = $GLOBALS["db"]->getAll($sql);
	$list = array();
	foreach($arr as $key => $val){
		$list[$val] = array();
	}
	foreach($info as $key => $val)
	{
		$list[$val["id"]] = $val;
	}
	return $list;

}

?>

